<?php
require_once("Includes.php");

class Student extends User
    {
     protected static $table_name="student";
	   protected static $db_fields = array('ID','user_ID', 'major' , 'minor' , 'level_ID');
       protected $ID;
       protected $user_ID;
	   protected $major;
	   protected $minor;
	   protected $level_ID;
	 
   public function set_id($ID)
   {
     $this->ID = $ID;
   }

   public function get_id()
   {
     return $this->ID;
   }

  public function set_user_id($ID)
  {
    $this->user_ID = $ID;
  }

  public function get_user_id()
  {
    return $this->user_ID;
  }

  public function set_major($major)
  {
    $this->major = $major;
  }

  public function get_major()
  {
   return $this->major;
  }

  public function set_minor($minor)
  {
    $this->minor = $minor;
  }

  public function get_minor()
  {
   return $this->minor;
  }

  public function set_level_id($ID)
  {
    $this->level_ID = $ID;
  }

  public function get_level_id()
  {
   return $this->level_ID;
  }
  public static function find_student_id($user_ID)
  {
    global $database;
    $sql="SELECT ID FROM ". self::$table_name ." WHERE user_ID='{$user_ID}'";
    $result = $database->doQuery($sql);
    $row = mysqli_fetch_array($result);
    return $row['ID'];
  }
  
}
?>